<?php
/*
* Kusht Mud.
* ----
* The MIT License
* Copyright (c) 2010 Andrew Tutt
* ----
*/

/* Character Class
*
* This is the Game Object for a ALL Characters including NPC MOBs
*/

require_once "BaseObject.class.inc";

class Character extends BaseObject {
	public $in_room;			// Room Object
	public $was_in_room;		// Room Object
	
	public $sex;				// Int for Gender
	public $level; 				// Level
	
	public $position;			// Standing, sleeping, etc.
	public $reply;				// The character who last spoke to you (might be useful for npcs too you know)
	
	// Applies only to NPCs and they don't have anywhere to put it.
	// Overriden in subclasses
	function send($msg) {
		return;
	}
	
	function move($exit_) {
		//if (!is_affected (AFF_SNEAK))
		cmdHandler::act ($this,"?n leaves ?T.", NULL, $exit_->tellOthers." ".$exit_->name, TO_ROOM);
		$this->in_room->rmv_char_from_room($this);
		$exit_->to_room->add_char_to_room($this);
		//if (!is_affected (AFF_SNEAK))
    	cmdHandler::act ($this,"?n has arrived.", NULL, NULL, TO_ROOM);
	}
	
	function is_awake() {
		return $this->position > POS_SLEEPING;
	}
	
	function describe_to ($looker) {
		if ($looker->can_see($this)) {
			return $this->name;
		} else {
			return "someone";
		}
	}
	
}

?>